[PATCH] posix: fix system when a child cannot be created [BZ #32450]
authorAurelien Jarno <aurelien@aurel32.net>
Thu, 19 Dec 2024 22:55:15 +0000 (23:55 +0100)
committerAurelien Jarno <aurel32@debian.org>
Wed, 22 Jan 2025 22:57:51 +0000 (23:57 +0100)
commitc90928830e4225900f5c97ca51c027147a50348c
treef3961f797971b54a9a9899c6b831dff19aacb3ec
parentcbcd94d559a653a94a7519b35c7aebe746118778
[PATCH] posix: fix system when a child cannot be created [BZ #32450]

POSIX states that "if a child process cannot be created, or if the
termination status for the command language interpreter cannot be
obtained, system() shall return -1 and set errno to indicate the error."

In the glibc implementation it could happen when posix_spawn fails,
which happens when the underlying fork, vfork, or clone call fails. They
could fail with EAGAIN and ENOMEM.

Resolves: BZ #32450
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Gbp-Pq: Topic any
Gbp-Pq: Name git-posix-fix-system-when-a-child-cannot-be-created-BZ-3.patch
stdlib/tst-system.c
sysdeps/posix/system.c